package com.yuyou.fn.platform.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.platform.entity.SysUser;
import com.yuyou.fn.platform.permission.DataPermission;
import com.yuyou.fn.platform.vo.SysUserQueryVo;
import com.yuyou.fn.platform.vo.SysUserSaveOrUpdateVo;

import java.util.List;

/**
 *
 * SysUser 表数据服务层接口
 *
 */
public interface ISysUserService extends ISuperService<SysUser,Long> {


    SysUser login(String username, String passwordMd5Hash );

    Page<SysUser> findSysUserByQueryForPage(SysUserQueryVo sysUserQueryVo, DataPermission dataPermission, int pageNo, int pageSize);

    Page<SysUser> findSysUserPageByQuery(SysUserQueryVo sysUserQueryVo, int pageNo, int pageSize);

    void saveOrUpdateSysUser(SysUserSaveOrUpdateVo sysUserSaveOrUpdateVo);

    void updateSysUserStatus(Long userId, Integer status);

    void changePassword(Long userId, String oldPassword, String newPassword);

    int checkPasswordStatus(Long userId);

    void deleteUser(Long userId );

    SysUser findByUserName(String userName);

    SysUser findByPhoneNo(String phoneNo);

    SysUser findByUserIdFromCache(Long userId);

    void changePassword(Long userId,String newPasswordMd5);

    void createSysUserIfNeed(Long userId, String realName, String phoneNo, String username, Integer userType);

    void resetDefaultPassword(Long userId);

    List<SysUser> findSysUserByStatus(Integer status);
}